﻿using System.Collections.Generic;
using System;

namespace IBE
{
    public class PNRBFPrimaryBldChgMods
    {
        public struct FNameItem
        {
            public string PsgrNum;
            public string AbsNameNum;
            public string FName;
            public string FNameRmk;
        }

        public struct Item
        {
            public string DataBlkInd;
            public string EditTypeInd;
            public string NameType;
            public string LNameID;
            public string LName;
            public FNameItem FNameItem;
        };

        #region Members
        //1
        List<Item> _ItemAry = new List<Item>();
        public List<Item> ItemAry { get { return _ItemAry; } set { _ItemAry = value; } }

        //2
        string _City = "";
        public string City { get { return _City; } set { _City = value; } }

        //3
        string _Type = "";
        public string Type { get { return _Type; } set { _Type = value; } }

        //4
        string _PhoneNumber = "";
        public string PhoneNumber { get { return _PhoneNumber; } set { _PhoneNumber = value; } }

        //5
        string _Tk = "";
        public string Tk { get { return _Tk; } set { _Tk = value; } }
        #endregion

        #region Method
        public string GetXml()
        {
            string xml = "<PNRBFPrimaryBldChgMods>";
            xml += "<ItemAry>";
            foreach (Item item in _ItemAry)
            {
                xml += "<Item>";
                xml += "<DataBlkInd>" + item.DataBlkInd + "</DataBlkInd>";
                xml += "<NameQual>";
                xml += "<EditTypeInd>" + item.EditTypeInd + "</EditTypeInd>";
                xml += "<AddChgNameRmkQual>";
                xml += "<NameType>" + item.NameType + "</NameType>";
                xml += "<LNameID>" + item.LNameID + "</LNameID>";
                xml += "<LName>" + item.LName + "</LName>";
                xml += "<NameTypeQual>";
                xml += "<FNameAry>";
                xml += "<FNameItem>";
                xml += "<PsgrNum>" + item.FNameItem.PsgrNum + "</PsgrNum>";
                xml += "<AbsNameNum>" + item.FNameItem.AbsNameNum + "</AbsNameNum>";
                xml += "<FName>" + item.FNameItem.FName + "</FName>";
                xml += "<FNameRmk>" + item.FNameItem.FNameRmk + "</FNameRmk>";
                xml += "</FNameItem>";
                xml += "</FNameAry>";
                xml += "</NameTypeQual>";
                xml += "</AddChgNameRmkQual>";
                xml += "</NameQual>";
                xml += "</Item>";
            }
            xml += "<Item>";
            xml += "<DataBlkInd>P</DataBlkInd>";
            xml += "<PhoneQual>";
            xml += "<EditTypeInd>A</EditTypeInd>";
            xml += "<AddPhoneQual>";
            xml += "<City>" + _City + "</City>";
            xml += "<Type>" + _Type + "</Type>";
            xml += "<PhoneNumber>" + _PhoneNumber + "</PhoneNumber>";
            xml += "</AddPhoneQual>";
            xml += "</PhoneQual>";
            xml += "</Item>";

            xml += "<Item>";
            xml += "<DataBlkInd>T</DataBlkInd>";
            xml += "<TkQual>";
            xml += "<Tk>" + _Tk + "</Tk>";
            xml += "</TkQual>";
            xml += "</Item>";

            xml += "<Item>";
            xml += "<DataBlkInd>E</DataBlkInd>";
            xml += "<EndMarkQual>";
            xml += "<EndMark>E</EndMark>";
            xml += "</EndMarkQual>";
            xml += "</Item>";
            xml += "</ItemAry>";
            xml += "</PNRBFPrimaryBldChgMods>";
            return xml;
        }
        #endregion
    }

    public class AirSegSellMods
    {
        public struct AirSegSell
        {
            public string Vnd;
            public string FltNum;
            public string Class;
            public string StartDt;
            public string StartAirp;
            public string EndAirp;
            public string Status;
            public string NumPsgrs;
            public string StartTm;
            public string EndTm;
            public string DtChg;
            public string AvailDispType;
            public string AvailJrnyNum;
            public string NeutralFltLineNum;
        }

        #region Members
        //1
        List<AirSegSell> _ListAirSegSell = new List<AirSegSell>();
        public List<AirSegSell> ListAirSegSell { get { return _ListAirSegSell; } set { _ListAirSegSell = value; } }
        #endregion

        #region Method
        public string GetXml()
        {
            string xml = "<AirSegSellMods>";
            foreach (AirSegSell item in _ListAirSegSell)
            {
                xml += "<AirSegSell>";
                xml += "<Vnd>" + item.Vnd + "</Vnd>";
                xml += "<FltNum>" + item.FltNum + "</FltNum>";
                xml += "<Class>" + item.Class + "</Class>";
                xml += "<StartDt>" + item.StartDt + "</StartDt>";
                xml += "<StartAirp>" + item.StartAirp + "</StartAirp>";
                xml += "<EndAirp>" + item.EndAirp + "</EndAirp>";
                xml += "<Status>" + item.Status + "</Status>";
                xml += "<NumPsgrs>" + item.NumPsgrs + "</NumPsgrs>";
                xml += "<StartTm>" + item.StartTm + "</StartTm>";
                xml += "<EndTm>" + item.EndTm + "</EndTm>";
                xml += "<DtChg>" + item.DtChg + "</DtChg>";
                xml += "<AvailDispType>" + item.AvailDispType + "</AvailDispType>";
                xml += "<AvailJrnyNum>" + item.AvailJrnyNum + "</AvailJrnyNum>";
                xml += "<NeutralFltLineNum>" + item.NeutralFltLineNum + "</NeutralFltLineNum>";
                xml += "</AirSegSell>";
            }
            xml += "</AirSegSellMods>";
            return xml;
        }
        #endregion
    }

    public class StorePriceMods
    {
        public struct Psgr
        {
            public string LNameNum;
            public string PsgrNum;
            public string AbsNameNum;
            public string PIC;
        }

        public struct SegRange
        {
            public string StartSeg;
            public string EndSeg;
            public string FareType;
            public string CRSInd;
            public string PCC;
            public string PublishedFaresInd;
            public string Type;
        }

        public struct StructGenQuoteInfo
        {
            public string BkDtOverride { get; set; }
            public string EUROverride { get; set; }
            public string LCUOverride { get; set; }
        }

        public struct StructSegSelection
        {
            public string ReqAirVPFs;
            public List<SegRange> SegRangeAry;
        }

        #region Members
        //1
        List<Psgr> _PsgrAry1 = new List<Psgr>();
        public List<Psgr> PsgrAry1 { get { return _PsgrAry1; } set { _PsgrAry1 = value; } }
        //2
        List<Psgr> _PsgrAry2 = new List<Psgr>();
        public List<Psgr> PsgrAry2 { get { return _PsgrAry2; } set { _PsgrAry2 = value; } }
        //3
        StructGenQuoteInfo _GenQuoteInfo = new StructGenQuoteInfo();
        public StructGenQuoteInfo GenQuoteInfo { get { return _GenQuoteInfo; } set { _GenQuoteInfo = value; } }
        //4
        StructSegSelection _SegSelection = new StructSegSelection();
        public StructSegSelection SegSelection { get { return _SegSelection; } set { _SegSelection = value; } }
        #endregion

        #region Method
        public string GetXml()
        {
            string xml = "<StorePriceMods>";
            //PsgrMods
            xml += "<PsgrMods>";
            xml += "<PsgrAry>";
            foreach (Psgr item in _PsgrAry1)
            {
                xml += "<Psgr>";
                xml += "<LNameNum>" + item.LNameNum + "</LNameNum>";
                xml += "<PsgrNum>" + item.PsgrNum + "</PsgrNum>";
                xml += "<AbsNameNum>" + item.AbsNameNum + "</AbsNameNum>";
                xml += "<PIC>" + item.PIC + "</PIC>";
                xml += "</Psgr>";
            }
            xml += "</PsgrAry>";
            xml += "</PsgrMods>";
            //AssocPsgrs
            xml += "<AssocPsgrs>";
            xml += "<PsgrAry>";
            foreach (Psgr item in _PsgrAry2)
            {
                xml += "<Psgr>";
                xml += "<LNameNum>" + item.LNameNum + "</LNameNum>";
                xml += "<PsgrNum>" + item.PsgrNum + "</PsgrNum>";
                xml += "<AbsNameNum>" + item.AbsNameNum + "</AbsNameNum>";
                xml += "</Psgr>";
            }
            xml += "</PsgrAry>";
            xml += "</AssocPsgrs>";
            //GenQuoteInfo
            xml += "<GenQuoteInfo>";
            xml += "<BkDtOverride>" + _GenQuoteInfo.BkDtOverride + "</BkDtOverride>";
            xml += "<EUROverride>" + _GenQuoteInfo.EUROverride + "</EUROverride>";
            xml += "<LCUOverride>" + _GenQuoteInfo.LCUOverride + "</LCUOverride>";
            xml += "</GenQuoteInfo>";
            //SegSelection
            xml += "<SegSelection>";
            xml += "<ReqAirVPFs>" + _SegSelection.ReqAirVPFs + "</ReqAirVPFs>";
            xml += "<SegRangeAry>";
            foreach (SegRange item in _SegSelection.SegRangeAry)
            {
                xml += "<SegRange>";
                xml += "<StartSeg>" + item.StartSeg + "</StartSeg>";
                xml += "<EndSeg>" + item.EndSeg + "</EndSeg>";
                xml += "<FareType>" + item.FareType + "</FareType>";
                xml += "<PFQual>";
                xml += "<CRSInd>" + item.CRSInd + "</CRSInd>";
                xml += "<PCC>" + item.PCC + "</PCC>";
                xml += "<PublishedFaresInd>" + item.PublishedFaresInd + "</PublishedFaresInd>";
                xml += "<Type>" + item.Type + "</Type>";
                xml += "</PFQual>";
                xml += "</SegRange>";
            }
            xml += "</SegRangeAry>";
            xml += "</SegSelection>";

            xml += "</StorePriceMods>";
            return xml;
        }
        #endregion
    }

    public class EndTransactionMods
    {
        #region Members
        //1
        string _ETInd = "";
        public string ETInd { get { return _ETInd; } set { _ETInd = value; } }

        //2
        string _RcvdFrom = "";
        public string RcvdFrom { get { return _RcvdFrom; } set { _RcvdFrom = value; } }

        //3
        string _SkipTEdits = "";
        public string SkipTEdits { get { return _SkipTEdits; } set { _SkipTEdits = value; } }
        #endregion

        #region Method
        public string GetXml()
        {
            string xml = "<EndTransactionMods>";
            xml += "<EndTransactRequest>";
            xml += "<ETInd>" + _ETInd + "</ETInd>";
            xml += "<RcvdFrom>" + _RcvdFrom + "</RcvdFrom>";
            xml += "</EndTransactRequest>";
            xml += "<ValidationControl>";
            xml += "<SkipTEdits>" + _SkipTEdits + "</SkipTEdits>";
            xml += "</ValidationControl>";
            xml += "</EndTransactionMods>";
            return xml;
        }
        #endregion
    }
}